package com.eshop.modules.system.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;

@TableName("roles_depts")
public class RolesDepts implements Serializable
{
    private Long roleId;
    private Long deptId;
    
    public void copy(final RolesDepts source) {
        BeanUtil.copyProperties(source, this, CopyOptions.create().setIgnoreNullValue(true));
    }
    
    public Long getRoleId() {
        return this.roleId;
    }
    
    public Long getDeptId() {
        return this.deptId;
    }
    
    public void setRoleId(final Long roleId) {
        this.roleId = roleId;
    }
    
    public void setDeptId(final Long deptId) {
        this.deptId = deptId;
    }
    
    @Override
    public boolean equals(final Object o) {
        if (o == this) {
            return true;
        }
        if (!(o instanceof RolesDepts)) {
            return false;
        }
        final RolesDepts other = (RolesDepts)o;
        if (!other.canEqual(this)) {
            return false;
        }
        final Object this$roleId = this.getRoleId();
        final Object other$roleId = other.getRoleId();
        Label_0065: {
            if (this$roleId == null) {
                if (other$roleId == null) {
                    break Label_0065;
                }
            }
            else if (this$roleId.equals(other$roleId)) {
                break Label_0065;
            }
            return false;
        }
        final Object this$deptId = this.getDeptId();
        final Object other$deptId = other.getDeptId();
        if (this$deptId == null) {
            if (other$deptId == null) {
                return true;
            }
        }
        else if (this$deptId.equals(other$deptId)) {
            return true;
        }
        return false;
    }
    
    protected boolean canEqual(final Object other) {
        return other instanceof RolesDepts;
    }
    
    @Override
    public int hashCode() {
        final int PRIME = 59;
        int result = 1;
        final Object $roleId = this.getRoleId();
        result = result * 59 + (($roleId == null) ? 43 : $roleId.hashCode());
        final Object $deptId = this.getDeptId();
        result = result * 59 + (($deptId == null) ? 43 : $deptId.hashCode());
        return result;
    }
    
    @Override
    public String toString() {
        return "RolesDepts(roleId=" + this.getRoleId() + ", deptId=" + this.getDeptId() + ")";
    }
}
